package com.homework.T6;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/4/2 18:48
 * @description
 */
public class fxTest {
    static HashMap<String,String> teachers = new HashMap<>();
    public static void main(String[] args) {

        tsput(teachers,"Tom","CoreJava");
        tsput(teachers,"John","Oracle");
        tsput(teachers,"Susan","Oracle");
        tsput(teachers,"Jerry","JDBC");
        tsput(teachers,"Jim","Unix");
        tsput(teachers,"Kevin","JSP");
        tsput(teachers,"Lucy","JSP");
        System.out.println("------------------");
        tsput(teachers,"Allen","JDBC");


        Set<String> namekey = teachers.keySet();
        for (String s : namekey) {
            if (s.equals("Lucy")){
                tsput(teachers,s,"CoreJava");
            }
        }

        for (String s : namekey) {
            System.out.println(s+":"+teachers.get(s));
        }

    }
    public static <N,K> void tsput(HashMap<N,K> ts,N name,K kecheng){
        ts.put(name,kecheng);
    }

}
